package leetcode.tree;


import leetcode.tree.common.TreeNode;
import leetcode.tree.common.TreeUtils;

import java.util.Arrays;
import java.util.List;

/**
 * AC
 */
class Solution107 {
    public List<List<Integer>> levelOrderBottom(TreeNode root) {

        return TreeUtils.levelOrderFromBottomToTop(root);

    }
}

/**
 * 107. 二叉树的层序遍历 II
 */
public class leetcode107 {
    public static void main(String[] args) {

        Integer[] arrP = {3, 9, 20, null, null, 15, 7};
        List<Integer> nodeListP = Arrays.asList(arrP);
        TreeNode root = TreeUtils.generateAtreeByBFSList(nodeListP);

        Solution107 solution107 = new Solution107();

        System.out.println("题目结果=====================");

        System.out.println(solution107.levelOrderBottom(root));

    }


}
